package 作业1022.zuoye2;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String a[] = {"aa", "bb", "cc", "dd"};
        int i =0;
        for (String as : a) {
            System.out.println(as);
        }
        System.out.println("输入要删除的");
        String b = input.next();
        for (i=0; i < a.length; i++) {
            if (a[i].equals(b)) {
                a[i] = null;
            }
        }
        for (int j = i; j < a.length - 1; j++) {
            a[j] = a[j + 1];
            if (j + 1 == a.length - 1) {
                a[j + 1] = null;
            }
        }
        for (String as1 : a) {
            System.out.print(as1);
        }
    }
}